<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>图片懒加载</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    
    .container {
      width: 500px;
      margin: 50px auto;
      border: 1px solid black;
      padding-right: 10px;
      padding-top: 10px;
    }
    ul {
      display: flex;
      flex-wrap: wrap;
      list-style: none;
      
    }

    ul li {
      margin-left: 10px;
    }
  </style>
</head>
<body>
  <div class="container">
    <ul>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      <li><img src="img/img1.png" class="list-img" data-src="img/img2.jpg" alt="图片"></li>
      
    </ul>
  </div>

  <script type="text/javascript" src="index.js"></script>
</body>
</html>